package com.xneure.zkweb.view;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.xneure.code.msg.MessageListener;
import com.xneure.code.msg.MsgManage;

@Component
@Scope("session")
public class Msg implements InitializingBean{
	MsgManage m = MsgManage.getMsgManage();
	boolean b = true;

	public MsgManage getM(){
		return m;
	}

	private MessageListener<MsgTest> sss(){
		return new MessageListener<MsgTest>(){
			@Override
			public void handler(MsgTest msg,Enum<?> action){
				System.out.println(msg.toString());
			}
		};
	}

	@Override
	public void afterPropertiesSet() throws Exception{
		m.registerListen(MsgTest.class,sss());
	}
}
